package com.ming.service.impl;

import com.ming.mapper.OwnerMapper;
import com.ming.pojo.Owner;
import com.ming.service.OwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OwnerServiceImpl implements OwnerService {

    @Autowired
    OwnerMapper ownerMapper;

    @Override
    public  List<Owner> allOwnerList() {

        return ownerMapper.ownerList();
    }

    @Override
    public  List<Owner> ownerListByName(String name) {
        name = '%' + name + '%';
        return ownerMapper.ownerListByName(name);

    }
    @Override
    public Owner ownerById(String ownerId) {
        return ownerMapper.ownerById(ownerId);
    }

    @Override
    public void addOwner(Owner owner) {
        ownerMapper.addOwner(owner);
    }

    @Override
    public void updateOwner(Owner owner) {
        ownerMapper.updateOwner(owner);
    }

    @Override
    public void  deleteOwner(String ownerId) {
        ownerMapper.deleteOwner(ownerId);
    }

}
